<?php
namespace Teemo\MVC;

use Teemo\Core\Config;
use Teemo\Pool\Context;
use Teemo\Helper\Template;
use Teemo\Core\Log;

/**
 * Created by PhpStorm.
 * User: lkk
 * Date: 2019/1/16
 * Time: 2:31 PM
 */
class Controller
{
    protected $request;
    /**
     * @var \Twig\Environment
     */
    protected $template;

    const _CONTROLLER_KEY_ = '__CTR__';
    const _METHOD_KEY_     = '__METHOD__';

    public function __construct()
    {
        //通过context拿到$request, 再也不用担收数据错乱了
        $context        = Context::getInstance()->get();
        $this->request  = $context->getRequest();
        $this->template = Template::getInstance()->template;
        Log::emergency(json_encode($this->template));
    }
}